{% extends "myapp/base.html" %}
{% block title %}
    添加相片
{% endblock %}
{% block content %}
    <!--文件上传-->
    <form method="post" action="{% url 'upload' %}" enctype="multipart/form-data">
        {# 取id号并隐藏 #}
        <input type="hidden" name="id" value="p.id"/>
        {# 解除csrf验证 #}
        {% csrf_token %}
        <table width="300">
            <tr>
                <td>标题</td>
                <td><input type="text" name="title"/></td>
            </tr>
            <tr>
                <td>上传文件</td>
                <td align="center"><input type="file" name="pic"/></td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" value="上传"/>
                    <input type="reset" name="重置"/>
                </td>
            </tr>
        </table>
    </form>
{% endblock %}